package cn.ljlao.mall.product.goods.feign;

import cn.ljlao.common.dto.SkuReductionTo;
import cn.ljlao.common.dto.SpuBoundTo;
import cn.ljlao.common.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @Author: LiuZhen
 * @Created: 2021/4/23 12:38
 * @Description:
 */
@FeignClient("mall-coupon")
public interface SpuBoundsFeign {
    /**
     * 1、couponFeignService.saveSpuBounds(spuBoundTo)找到这个远程服务
     * 2、将saveSpuBounds(@RequestBody SpuBoundTo spuBounds)请求体转换为json
     * 3、找到gulimall-coupon服务，发送/coupon/spubounds/save请求
     * 4、远程服务save(@RequestBody SpuBoundsEntity spuBounds)收到请求
     *    将请求体中的json转换为SpuBoundsEntity
     */
    @PostMapping("/coupon/spubounds/save")
    public R saveSpuBounds(@RequestBody SpuBoundTo spuBounds);

    @PostMapping("/coupon/skufullreduction/saveInfo")
    R saveSkuReduction(@RequestBody SkuReductionTo skuReductionTo);


    // 查询 sku 是否有库存
    @PostMapping("/coupon/coupon/saveaa")
    void saveaa();

}
